package com.foodplus.www.presenter;

import com.foodplus.www.api.BaseSubscriber;
import com.foodplus.www.api.ExceptionHandle;
import com.foodplus.www.bean.shop.ShopBean;
import com.foodplus.www.model.impl.ShopModelImpl;
import com.foodplus.www.view.impl.ShopView;

import java.util.Map;

/**
 * Created by WangZhiChao on 2016/10/31.
 */

public class ShopPresenter {


    ShopView view;

    public ShopPresenter(ShopView view) {
        this.view = view;
    }

    public void getShopData( Map<String, String> params) {
        new ShopModelImpl().getShopData(new BaseSubscriber<ShopBean>() {
            @Override
            public void onSuccess(ShopBean shopBean) {
                view.onSuccess(shopBean);
            }

            @Override
            public void onFail(ExceptionHandle.ResponeThrowable e) {
                view.onFail(e);
            }

            @Override
            public void onFinished() {
                view.onFinish();
            }
        }, params);
    }
}
